//
//  MJ_SearchBar.m
//  UEAssistant
//
//  Created by mac on 2018/1/9.
//  Copyright © 2018年 youyixinxi. All rights reserved.
//

#import "MJ_SearchBar.h"

@implementation MJ_SearchBar

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        [btn setTitle:@"搜索" forState:UIControlStateNormal];
        [btn setImage:[UIImage imageNamed:@"Nav Bar_搜索"] forState:UIControlStateNormal];
        btn.backgroundColor = [UIColor colorWithHexString:@"#dddddd"];
        btn.titleLabel.font = [UIFont systemFontOfSize:14];
        btn.layer.cornerRadius = 5;
        btn.layer.masksToBounds = YES;
        [btn setTitleColor:[UIColor colorWithHexString:@"#999999"] forState:UIControlStateNormal];
        btn.frame = CGRectMake(18, 7, Screen_Width-36, 30);
        [btn addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:btn];
    }
    return self;
}

- (void)buttonPressed:(UIButton *)sender {
    self.ClickSearchBarBlock(sender);
}

@end
